#include <REGX52.H>
void delay_ms(unsigned int ms)
{
    unsigned int i, j;
    for (i = 0; i < ms; i++)
    {
        for (j = 0; j < 123; j++)
            ;
    }
}
void main()
{
    unsigned int i;
    while(1)
    {
        P2=0x21;
        delay_ms(5000);
        for (i=0;i<3;i++)
        {
          P2=0x24;
          delay_ms(500);
          P2_2=~P2_2;
          delay_ms(500);
        }
        P2=0x12;
        delay_ms(5000);
        for (i=0;i<3;i++)
        {
          P2=0x42;
          delay_ms(500);
          P2_6=~P2_6;
          delay_ms(500);
        }
    }
}